<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li
    :class="{completed : item.completed}"
    v-for="item in todos" :key="item.id"
    >
      <div class="view">
        <input class="toggle" type="checkbox" v-model="item.completed"/>
        <label>{{item.title}}</label>
        <button class="destroy"></button>
      </div>
    </li>
  </ul>

</template>

<script>
export default {
  props: ['todos']
}
</script>
